#pragma once
/****************************************************创建型方式 工厂方法******************************************************/

class Product
{
public:
    Product() = default;
    ~Product() = default;

    virtual void Operation() = 0;
};

class ProductA : public Product
{
public:
    ProductA() = default;
    ~ProductA() = default;

    virtual void Operation();
};

class ProductB : public Product
{
public:
    ProductB() = default;
    ~ProductB() = default;

    virtual void Operation();
};



class Creator
{
public:
    Creator() = default;
    ~Creator() = default;

    virtual Product* FactoryMethod() const = 0;

    void SomeOperation() const;
};

class ConcreteCreatorA : public Creator
{
public:
    ConcreteCreatorA() = default;
    ~ConcreteCreatorA() = default;

    virtual Product* FactoryMethod() const override;
};

class ConcreteCreatorB : public Creator
{
public:
    ConcreteCreatorB() = default;
    ~ConcreteCreatorB() = default;

    virtual Product* FactoryMethod() const override;
};